package voinarovskaya.pages;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
import org.openqa.selenium.support.PageFactory;

public class AddFilmPage extends Page {
	
	@FindBy(how = How.ID , using = "imdbsearch")	
	public WebElement ImdbSearchField;
	
	@FindBy(how = How.XPATH , using = "//*[@value='Search']")	
	public WebElement ImdbSearchButton;
	
	@FindBy(how = How.NAME , using = "imdbid")	
	public WebElement IMDbNumber;
	
	@FindBy(how = How.NAME , using = "name")	
	public WebElement Title;
	
	@FindBy(how = How.NAME , using = "year")	
	public WebElement Year;
	
	@FindBy(how = How.XPATH , using = "//*[@alt='Save']")	
	public WebElement Save;
	
	@FindBy(how = How.ID , using = "formats")	
	public WebElement Formats;
	
	@FindBy(how = How.ID , using = "seen_no")	
	public WebElement SeenMovie;	
	
	
	public AddFilmPage(WebDriver webDriver) {
		super(webDriver);
		PageFactory.initElements(webDriver, this);
	}
	
	public IMDbResultPage ImdbSearch(){
		ImdbSearchButton.click();
		return new IMDbResultPage (webDriver);
	}

}
